/************************************************************************************************************
**	Project: Dreamgineer Arduino Libraries
**
**	BlinkM.cpp - Arduino BlinkM Library
**
**	Written By: 	Sam Kristoff
**  Written On: 	June 2012
**  Last Updated: 	June 2012
**
**	Provides BlinkM Functions For Use With Arduino
**
************************************************************************************************************/

/************************************************************************************************************
**------------------------------------------------ Includes -------------------------------------------------
************************************************************************************************************/
#include "BlinkM.h"
#include "../Wire/Wire.h"

/************************************************************************************************************
**---------------------------------------------- Constructors -----------------------------------------------
************************************************************************************************************/

BlinkM::BlinkM(unsigned char address)
{
	Address = address;  // Store The User Assigned Address For Later Writes To The BlinkM
	Wire.begin();		// Arduino Join The I2C Bus As A Master Device
}

//Go To RGB Color Now Command
void BlinkM::gotoRGB(unsigned char r, unsigned char g, unsigned char b)
{
	Wire.beginTransmission(Address);
	Wire.write(r);
	Wire.write(g);
	Wire.write(b);
	Wire.endTransmission();
}
